name = "几何布局"
description = "放置时将对象捕捉到网格并在其周围显示构建网格"
author = "温如言"
version = "1.0.0"

forumthread = ""
api_version_dst = 10

priority = 0

icon_atlas = "modicon.xml"
icon = "modicon.tex"

dst_compatible = true

client_only_mod = true

local smallgridsizeoptions = {}
for i=0,10 do smallgridsizeoptions[i+1] = {description=""..(i*2).."", data=i*2} end
local medgridsizeoptions = {}
for i=0,10 do medgridsizeoptions[i+1] = {description=""..(i).."", data=i} end
local biggridsizeoptions = {}
for i=0,5 do biggridsizeoptions[i+1] = {description=""..(i).."", data=i} end

local KEY_A = 65
local keyslist = {}
local string = "" -- can't believe I have to do this... -____-
for i = 1, 26 do
	local ch = string.char(KEY_A + i - 1)
	keyslist[i] = {description = ch, data = ch}
end
keyslist[27] = {description = "None", data = ""}

local percent_options = {}
for i = 1, 10 do
	percent_options[i] = {description = i.."0%", data = i/10}
end
percent_options[11] = {description = "Unlimited", data = false}

local placer_color_options = {
	{description = "Green", data = "green", hover = "The normal green  the game uses."},
	{description = "Blue", data = "blue", hover = "Blue, helpful if you're red/green colorblind."},
	{description = "Red", data = "red", hover = "The normal red the game uses."},
	{description = "White", data = "white", hover = "A bright white, for better visibility."},
	{description = "Black", data = "black", hover = "Black, to contrast with the brighter colors."},
}
local color_options = {}
for i = 1, #placer_color_options do
	color_options[i] = placer_color_options[i]
end
color_options[#color_options+1] = {description = "Outlined White", data = "whiteoutline", hover = "White with a black outline, for the best visibility."}
color_options[#color_options+1] = {description = "Outlined Black", data = "blackoutline", hover = "Black with a white outline, for the best visibility."}
local hidden_option = {description = "Hidden", data = "hidden", hover = "Hide it entirely, because you didn't need to see it anyway, right?"}
placer_color_options[#placer_color_options+1] = hidden_option
color_options[#color_options+1] = hidden_option

configuration_options =
{
	{
		name = "CTRL",
		label = "CTRL转动网格",
		hover = "按住CTRL键是启用还是禁用mod",
		options =	{
						{description = "启用", data = true},
						{description = "禁用", data = false},
					},
		default = true,
	},
    {
        name = "KEYBOARDTOGGLEKEY",
        label = "选项按钮",
		hover = "用于打开mod选项的游戏内菜单的键。默认按钮是键盘上的B。在控制器上，在记分板上使用左键单击将打开它(您可以重新绑定Menu Misc 3以更改它)",
        options = keyslist,
        default = "B",
    },    
    {
        name = "GEOMETRYTOGGLEKEY",
        label = "切换按钮",
		hover = "在最近使用的几何图形之间切换的键(它将猜测是否不知道，仅当您在洞穴和地面之间转移或加入游戏时才会发生)。默认按钮是键盘上的V。控制器没有绑定",
        options = keyslist,
        default = "V",
    },    
    {
        name = "SNAPGRIDKEY",
        label = "对齐网格按钮",
		hover = "使网格移动以在光标下的对象或图块的关键点(中心、边缘、角；技术上是图块内的5x5点网格)上有一个点的键。键盘上的默认按钮未绑定，控制器没有绑定",
        options = keyslist,
        default = "N",
    },    
    {
        name = "SHOWMENU",
        label = "游戏内菜单",
		hover = "启用:(默认)选项按钮将显示菜单\n禁用:它只会打开和关闭mod(就像在菜单之前一样)",
		options =	{
						{description = "启用", data = true},
						{description = "禁用", data = false},
					},
        default = true,
    },    
	{
		name = "BUILDGRID",
		label = "显示构建网格",
		hover = "是否显示生成网格",
		options =	{
						{description = "启用", data = true},
						{description = "禁用", data = false},
					},
		default = true,	
	},
	{
		name = "GEOMETRY",
		label = "网格几何",
		hover = "正方形:(默认)是正常网格，与游戏的XZ坐标系对齐。六边形的几何形状可以让您绘制最紧凑的图",
		options =	{
						{description = "正方形", data = "SQUARE"},
						{description = "菱形", data = "DIAMOND"},
						{description = "X六边形", data = "X_HEXAGON"},
						{description = "Z六边形", data = "Z_HEXAGON"},
						{description = "平六边形", data = "FLAT_HEXAGON"},
						{description = "尖六边形", data = "POINTY_HEXAGON"},
					},
		default = "SQUARE",	
	},
	{
		name = "TIMEBUDGET",
		label = "刷新率",
		hover = "有多少可用时间用于刷新网格。较高的设置会使网格更新更快，但可能会导致滞后",
		options = percent_options,
		default = 0.1,	
	},
	{
		name = "HIDEPLACER",
		label = "隐藏放置者",
		hover = "是否隐藏放置器(正在放置的项目的重影版本)。\n隐藏它可以帮助您更好地查看网格",
		options =	{
						{description = "启用", data = true},
						{description = "禁用", data = false},
					},
		default = false,	
	},
	{
		name = "HIDECURSOR",
		label = "隐藏光标",
		hover = "是否隐藏光标项，以便更好地查看网格",
		options =	{
						{description = "隐藏全部", data = 1},
						{description = "展示数字", data = true},
						{description = "展示全部", data = false},
					},
		default = false,	
	},
	{
		name = "SMARTSPACING",
		label = "智能间距",
		hover = "启用:放置物品时，网格间距会适应放置的物品；最近的自由网格点应始终是最近的可能距离。禁用:(默认)对所有内容保持相同的间距",
		options =	{
						{description = "启用", data = true},
						{description = "禁用", data = false},
					},
		default = true,	
	},
	{
		name = "ACTION_TILL",
		label = "耕作格栅",
		hover = "是否使用网格耕作农田土壤。\n使用捕捉耕作模式时自动关闭",
		options =	{
						{description = "启用", data = true},
						{description = "禁用", data = false},
					},
		default = true,	
	},
	{
		name = "SMALLGRIDSIZE",
		label = "精细网格尺寸",
		hover = "放置可以紧密包装的东西时，网格应该在每个方向上走多少点。默认为10",
		options = smallgridsizeoptions,
		default = 10,	
	},
	{
		name = "MEDGRIDSIZE",
		label = "中等网格尺寸",
		hover = "使用中等网格（如墙、DST作物）的东西的网格有多大",
		options = medgridsizeoptions,
		default = 6,	
	},
	{
		name = "BIGGRIDSIZE",
		label = "大网格尺寸",
		hover = "使用大网格的东西（如草皮和干草叉）的网格有多大",
		options = biggridsizeoptions,
		default = 2,	
	},
	{
		name = "GOODCOLOR",
		label = "不锁定颜色",
		hover = "用于未阻塞点的颜色，用于放置物品",
		options = color_options,
		default = "whiteoutline",	
	},
	{
		name = "BADCOLOR",
		label = "锁定颜色",
		hover = "用于无法放置对象的阻塞点的颜色",
		options = color_options,
		default = "blackoutline",	
	},
	{
		name = "NEARTILECOLOR",
		label = "Nearest Tile Color",
		hover = "用于最近的平铺轮廓的颜色",
		options = color_options,
		default = "white",	
	},
	{
		name = "GOODTILECOLOR",
		label = "Unblocked Tile Color",
		hover = "用于放置草皮的草皮瓷砖网格的颜色",
		options = color_options,
		default = "whiteoutline",	
	},
	{
		name = "BADTILECOLOR",
		label = "Blocked Tile Color",
		hover = "用于不能放置草皮的草皮瓷砖网格的颜色",
		options = color_options,
		default = "blackoutline",	
	},
	{
		name = "GOODPLACERCOLOR",
		label = "不锁定放置者颜色",
		hover = "用于解除阻止的放置程序的颜色(所放置对象的“阴影副本”)",
		options = placer_color_options,
		default = "white",	
	},
	{
		name = "BADPLACERCOLOR",
		label = "锁定放置者颜色",
		hover = "要用于被阻止的放置器的颜色(正在放置的对象的“阴影副本”)",
		options = placer_color_options,
		default = "black",	
	},
	{
		name = "REDUCECHESTSPACING",
		label = "紧凑箱子",
		hover = "是否允许箱子比正常位置靠得更近。\n这在DST中可能不起作用",
		options =	{
						{description = "启用", data = true},
						{description = "禁用", data = false},
					},
		default = true,	
	},
	{
		name = "CONTROLLEROFFSET",
		label = "控制器补偿",
		hover = "启用:使用法线偏移，它会随着玩家旋转。禁用:(默认)使对象保持在玩家脚下，从而更容易将其放置在您想要的位置",
		options =	{
						{description = "启用", data = true},
						{description = "禁用", data = false},
					},
		default = false,	
	},
}